<template>
  <view class="container">
    <view class="header">
      <view class="flex-row-align-center">
        <image class="avatar"
          :src="privacyData.avatarUrl || 'https://talentsupload.oss-cn-beijing.aliyuncs.com/miniprogram/default_2.png'" />
        <view class="user-info">
          <view>{{privacyData.nickName || '--'}}</view>
          <view class="margin-t-th font-size-24">{{privacyData.roleType || '--'}}</view>
          <view class="flex-row-align-center margin-t-ten">
            <text class="font-size-24">{{info.vip ? '企业管理员已认证' : '未认证'}}</text>
            <image class="mark-img"
              src="https://talentsupload.oss-cn-beijing.aliyuncs.com/miniprogram/mine/roleSymbol.png" />
          </view>
        </view>
        <view class="rights-and-interests" v-if="isBoss || isHr">
          <image class="mark-img"
            src="https://talentsupload.oss-cn-beijing.aliyuncs.com/miniprogram/mine/diamond.png" />
          <text class="font-size-24">到期时间 {{info.vip?.expirationTime || '--'}}</text>
        </view>
      </view>
    </view>

    <custom-CompanyInfo />
    <view class="buy common-bg-white between-item-center-row" v-if="companyInfo.enterpriseId">
      <view
        v-if="isBoss"
        @tap="handleFunc" 
        :data-item="{
          pageUrl: '/pages/purchaseVip/index',
          vipTimes: info.vip?.expirationTime || '--'
        }" 
        class="flex-row-align-center"
        >
        <image class="buy-rights-and-interests"
          src="https://talentsupload.oss-cn-beijing.aliyuncs.com/miniprogram/mine/buyRightsAndInterests.png" />
        <text>购买权益</text>
      </view>
      <!--   open-type="share"-->
      <button 
        hover-class="none" 
        plain="true"
        v-if="isBoss || isHr"
        class="share share-btn flex-row-align-center"
        @click="shareAppraisal"
      >
        <image
          class="qr-code"
          src="https://talentsupload.oss-cn-beijing.aliyuncs.com/miniprogram/mine/buyRightsAndInterests.png"
        />
        <text>测评二维码</text>
      </button>
      <button 
        hover-class="none" 
        plain="true" 
        class="share share-btn flex-row-align-center" 
        open-type="share"
      >
        <image
          class="qr-code"
          src="https://talentsupload.oss-cn-beijing.aliyuncs.com/miniprogram/mine/myQRCode.png"
        />
        <text>邀请朋友</text>
      </button>
    </view>

    <view class="func common-bg-white">
      <block v-for="(item, index) in funcList" :key="index">
        <view class="func-item between-item-center-row" @tap="handleFunc" :data-item="item" :data-type="item.type">
          <view class="flex-row-align-center">
            <image :style="{ width: `${item.iconWidth}rpx`, height: `${item.iconHeight}rpx` }" :src="item.icon" />
            <text>{{item.title}}</text>
          </view>
          <view class="right" v-if="item.rightText">{{item.rightText}}</view>
        </view>
      </block>
    </view>
  </view>
</template>
<script src="./indexMod.js" />
<style src="./indexStyle.scss" lang="scss" scoped>
</style>